/*
 * StabSolvers.h
 *
 *  Created on: Sep 19, 2011
 *      Author: correa
 */

#ifndef COMBSTABSOLVERS_H_
#define COMBSTABSOLVERS_H_

#include "../graph/Graph.h"
#include "../stab/StabSolver.h"

template <typename S>
class SubpGen {
private:
	Graph* g;
protected:
	Graph * graph() { return g; };
public:
	SubpGen(int nt, Graph* g);
	SubpGen(){};
	virtual ~SubpGen() {};
	virtual S *			root() = 0;
	virtual void 		generate(S* s, S** queue, int* q, long* nodes) = 0;
	virtual double		getBest() = 0;
	virtual int			numThreads() = 0;
};

template<typename S>
class BackTrack : public StabSolver {
	SubpGen<S> * sg;
	long nnodes;
	double qmax;
protected:
	BackTrack(SubpGen<S>* gen) : StabSolver(), sg(gen) {};
//	BackTrack(Graph * g, Weight<double> * w);
public:
	virtual ~BackTrack() {};
	int solveByEnumeration();
	int getBest(double* val);
	int getNodes(int* nnd);
};


#endif /* STABSOLVERS_H_ */
